{if $itemList neq null}
	{volist name="itemList" id="vo"}
	<div class="layui-input-inline">
		<select name="{$vo.code}_id" id="{$vo.code}_id" lay-filter="{$vo.code}_id" lay-search="">
			<option value="">【请选择{$vo.tname}】</option>
			{volist name="vo['list']" id="val"}
				<option value="{$val.id}" {if $val.id==$vo['selected']}selected=""{/if}>{$val.name}</option>
			{/volist}
		</select>
	</div>
	{/volist}
{/if}

<script type="text/javascript">
layui.use(['form'],function(){

	// 声明变量
	var layer = layui.layer
	,form = layui.form
	,$ = layui.$;

	// 选择站点
	form.on('select(item_id)',function(data){
		var id = data.value;
		console.log("站点ID:"+id);
		var select = data.othis;
		if (select[0]) {
			if (id > 0) {
				$.post("/itemcate/getCateList", { 'item_id':id }, function(data){
					if (data.success) {
						var str = "";
						$.each(data.data, function(i,item){
							str += "<option value=\"" + item.id + "\" >" + item.name + "</option>";
						});
						$("#cate_id").html('<option value="">【请选择栏目】</option>' + str);
						form.render('select');
					}else{
						$("#cate_id").html('');
						form.render('select');
						layer.msg(data.msg,{ icon: 5 });
						return false;
					}
				}, 'json');
			} else {
				
			}
		}
	});
	
	// 选择栏目
	form.on("select(cate_id)",function(data){
		var id = data.value;
		console.log("栏目ID:"+id);
	});
	
});
</script>